<?php
 
/**
 * only a few lines of code will make the best web framework
 * function on the command line
 */
 
    /* we don't need to be limited by...normal limitations */
    set_time_limit(0);
    ini_set('memory_limit', '256M');
    echo "===================================";
 
    /* make sure this isn't being called by a web browser */
    if (isset($_SERVER['REMOTE_ADDR'])) die('Permission denied.');
 
    /* set some constants */
    define('CMD', 1);
    
    echo "start cli";
    var_dump($argv);
 
    /* manually set the URI path based on command line arguments... */
    unset($argv[0]); /* ...but not the first one */
   
    $url = '/' . implode('/', $argv) . '/';

    $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'] = '/' . implode('/', $argv) . '/';
    
    include(dirname(__FILE__).'/index.php');
?>